#include<stdio.h> 
#include<math.h> 

int main(){

    //求根公式   

    char choose;

    do {
        printf("please enter the coefficient a,b,c as:\n"); 
        int a,b,c; 
        double x1,x2;
        double delta;

        //scanf("the equation is:%dx*2+%dx+%d\n",&a,&b,&c);
        scanf("%d %d %d",&a,&b,&c);
        delta=pow(b,2)-4*a*c;
        // printf("%lf",delta);
        x1=(-b+sqrt(delta))/(2*a);
        x2=(-b-sqrt(delta))/(2*a);

        printf("the result is:");

        if(delta<0){
            printf("there's no solution\n");
        }
        else if(delta>0){
            printf("x1=%lf,x2=%lf\n",x1,x2);
            }
            else{
                printf("x1=x2=%lf\n",x1);
            }
        
        printf("if you want to use agein,enter y:\n");
        scanf(" %c",&choose); //把enter作为换行符检测到了=.=
        
    }while(choose=='y');


    
}